#include<iostream>
#include<string>
#include<unistd.h>
using namespace std;


class channel
{
public:
    channel(int wfd, int pid) : _wfd(wfd), _pid(pid)
    {
        _name = "channel wfd:" + to_string(wfd) + " pid" + to_string(pid);
    }

    string Name()
    {
        return _name;
    }
    void Send(int num)
    {
        write(_wfd, &num, 4);
    }
    void Close()
    {
        close(_wfd);
    }
    int Id()
    {
        return _pid;
    }
private:
    int _wfd;
    int _pid;
    string _name;
};